package org.example.dao.dao.post;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.dao.dto.post.PostDto;
import org.example.dao.entity.post.PPost;
import org.example.partten.builder.product.post.PPostDto;

import java.util.List;

/**
 * (PPost)表数据库访问层
 *
 * @author makejava
 * @since 2023-09-14 09:51:56
 */
@Mapper
public interface PPostDao extends BaseMapper<PPost> {

    /**
     * 根据id获取postdto
     */
    PostDto getPostDtoById(@Param("postId") Long postId);

    /**
     * 获取自己发布的帖子
     */
    List<PostDto> getPostDtoByMine(@Param("userId") Long userId,
                                   @Param("start")Integer start,@Param("limit") Integer limit);

    Integer getPostDtoByMineNum(@Param("userId")Long userId);

    /**
     * 获取构造commom的ids
     */
    List getPostIds(@Param("themeId")Integer themeId,@Param("start") Integer start,@Param("limit") Integer limit);


}

